import Vue from 'vue'
import VueRouter from "vue-router";

import login from "../components/login"

import publicMan from "../components/public/public"
import p_arrange from "../components/public/arrange"
import p_lab from "../components/public/lab"
import p_semester from "../components/public/semester"

import manager from "../components/admin/manager"
import semester from "../components/admin/semester";
import lab from "../components/admin/lab"
import teaReq from "../components/admin/teaReq"
import stuReq from "../components/admin/stuReq"
import user from "../components/admin/user";
import student from "../components/admin/student"

import teacher from "../components/teacher/teacher"
import labRep from "../components/teacher/labRep"
import teaToReq from "../components/teacher/teaToReq"

import tester from "../components/tester/tester"
import repair from "../components/tester/repair"

import students from "../components/student/students"
import stuToReq from "../components/student/stuToReq"
import arrange4clazz from "../components/student/arrange4clazz"


Vue.use(VueRouter)

const router = new VueRouter({
    routes: [
        { path: '/', redirect: 'public' },
        { path: '/login', component: login },
        {
            path: '/manager', component: manager, children: [
                { path: 'semester', component: semester },
                { path: 'lab', component: lab },
                { path: 'teaReq', component: teaReq },
                { path: 'stuReq', component: stuReq },
                { path: 'user', component: user },
                { path: 'student', component: student },
                { path: 'arrange', component: p_arrange },
            ]
        },
        {
            path: '/teacher', component: teacher, children: [
                { path: 'labRep', component: labRep },
                { path: 'teaToReq', component: teaToReq },
                { path:'lab', component:p_lab},
                { path: 'semester', component: p_semester },
                { path: 'arrange', component: p_arrange },
            ]
        },
        {
            path: '/tester', component: tester, children: [
                { path: 'repair', component: repair },
                { path:'lab', component:p_lab},
                { path: 'semester', component: p_semester },
                { path: 'arrange', component: p_arrange },
            ]
        },
        {
            path: '/student', component: students, children: [
                { path: 'stuToReq', component: stuToReq },
                { path:'lab', component:p_lab},
                { path: 'semester', component: p_semester },
                { path: 'arrange', component: p_arrange },
                { path: 'arrange4clazz', component: arrange4clazz },
            ]
        },
        {
            path: '/public', component: publicMan, children: [
                { path:'lab', component:p_lab},
                { path: 'semester', component: p_semester },
                { path: 'arrange', component: p_arrange },
            ]
        },
    ]
})

export default router